Merge pull request #2 from dsander/rails41-deploy

Deployable via the chef-solo branch

Dominik Sander 11 years ago
parent
commit
03a2b09cfa
3 changed files with 9 additions and 2 deletions
  1. 1 0
      .env.example
  2. 5 0
      Gemfile
  3. 3 2
      config/environments/production.rb

+ 1 - 0
.env.example

@@ -30,6 +30,7 @@ DATABASE_PASSWORD=""
30 30
 
31 31
 # Configure Rails environment.  This should only be needed in production and may cause errors in development.
32 32
 # RAILS_ENV=production
33
+FORCE_SSL=false
33 34
 
34 35
 #############################
35 36
 #    Email Configuration    #

+ 5 - 0
Gemfile

@@ -66,3 +66,8 @@ group :development, :test do
66 66
   gem 'webmock', require: false
67 67
   gem 'coveralls', require: false
68 68
 end
69
+
70
+group :production do
71
+  gem 'dotenv-deployment'
72
+  gem 'rack'
73
+end

+ 3 - 2
config/environments/production.rb

@@ -31,13 +31,14 @@ Huginn::Application.configure do
31 31
 
32 32
   # Generate digests for assets URLs
33 33
   config.assets.digest = true
34
+  config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
34 35
 
35 36
   # Specifies the header that your server uses for sending files.
36 37
   # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
37 38
   # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
38 39
 
39 40
   # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
40
-  config.force_ssl = true
41
+  config.force_ssl = ENV['FORCE_SSL'].present? && ENV['FORCE_SSL'] == 'true' ? true : false
41 42
 
42 43
   # See everything in the log (default is :info)
43 44
   # config.log_level = :debug
@@ -88,4 +89,4 @@ Huginn::Application.configure do
88 89
   config.action_mailer.raise_delivery_errors = true
89 90
   config.action_mailer.delivery_method = :smtp
90 91
   # smtp_settings moved to config/initializers/action_mailer.rb
91
-end
92
+end